def Comb(n):
	return n*(n-1)*(n-2)/6

def Check(graph, v1, v2, n):
	cnt = 0
	for x in range(n):
		if graph[v1][x] == 1 and graph[v2][x] == 1:
			cnt += 1
	return cnt

k = input()

graph = [[0 for x in range(100)] for y in range(100)]

cnt = 0
while cnt<k:
	for x in range(1, 100):
		for y in range(x):
			tmp = Check(graph, x, y, x)
			if tmp + cnt <= k:
				graph[x][y] = 1
				graph[y][x] = 1
				cnt += tmp
			else:
				break;
		if cnt == k:
			print x+1
			for i in range(x+1):
				print "".join(map(str, graph[i][:x+1]))
			break;

	
